All Questions
24 questions
3votes
0answers
462views
Making a fast Mandelbrot Fractal viewer
I'm making a Mandelbrot set viewer in JavaFX. It takes a while, like maybe 5 seconds to finish. Here's my code: ...
1vote
2answers
286views
"Disease Spread" challenge
Right now I'm solving this problem on codewars.com. I'm not sure about how to optimise the code further. Or is my algorithm inefficient? If it's an algorithmic issue, could someone help me how to go ...
1vote
5answers
559views
Optimizing program to output all numbers summing to 100
I just finished my program which calculates the solutions to this problem: Outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100. ...
5votes
1answer
2kviews
Rational Polynomial Factoring method
I have written a class containing methods to factor a polynomial equation using the p over q method. The method returns a string that is the factored equation. Here is the class (can also be found ...
0votes
1answer
2kviews
Eigenvalue calculation for a Java matrix library [closed]
After an interview didn't go smoothly, I decided to write my own library so that I would be better prepared if I'm ever asked about matrix multiplication again. I know that doing it in Java is going ...
4votes
1answer
2kviews
Pollard p - 1 implementation
I'm trying to implement the Pollard p - 1 algorithm seen here, in Java. It has a C implementation here. I am using it for numbers without any smaller factors so trial factorisation isn't needed. My ...
3votes
2answers
365views
BigRational based on BigIntegers
For Project Euler I've implemented a BigRational. The functionality is rather limited, just things I needed or will probably need soon. The style departs a bit from ...
15votes
1answer
2kviews
Multiplication 128 x 64 bits
I was fooling around with the Collatz sequence a bit and found out that long is only sufficient for starting values below ...
11votes
3answers
2kviews
Algorithm to calculate semi perfect integers, lack of efficiency
I'm working on an algorithm to calculate weird numbers, and to do so there are several properties that needs to be calculated, one of them being, if it is NOT a semi-perfect/pseudoperfect number. My ...
4votes
1answer
1kviews
Followup: How do I optimize this Java cube root function for BigInteger?
Followup to How do I optimize this Java cube root function for BigInteger? So I've tried several implementations of this algorithm. The version using only BigInteger sometimes results in a never-...
7votes
1answer
3kviews
How do I optimize this Java cube root function for BigInteger?
I find that this function is one of the biggest causes of slow program execution. I can write a square root version with BigInteger only, but with the cube root, the algorithm sometimes gets caught in ...
6votes
4answers
125views
Calculation of e performance issue
Can you give me some idea how to optimize the switch statements, maybe a for or do while ...
0votes
2answers
1kviews
Pythagorean triplets
This code is about finding Pythagorean triplets. I take a number as input, and find from 1 to that number, how many Pythagorean triplets exist. Are there ways this can be optimized? It takes a lot ...
5votes
3answers
1kviews
Better performance in calculating E
Can you give me some performance advice on how to optimize the time of execution of the following calculation of E? ...
8votes
2answers
2kviews
Finding the nearest Rational to a double - is there a more efficient mechanism?
I use the following code to find the lowest denominator Rational that is within a certain delta from a double. The rationale is that the I am pulling float numbers ...